
import java.io.File;
import java.util.logging.Logger;
import net.milkbowl.vault.Vault;
import net.milkbowl.vault.permission.Permission;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author fabio
 */
public class Main extends JavaPlugin {

    public static final Logger log = Logger.getLogger("Minecraft");
    //CmdHandler cmdExec;
    public static Main one;
    public static Permission perms;
    Vault vault;
    
    @Override
    public void onDisable() {
        log.info("[TheLostFortress] Exit.");
    }
    
    @Override
    public void onEnable() {
        File dir = new File("TheLostFortress");
        if (!dir.exists()) {
            dir.mkdirs();
        }
        vault = (Vault) this.getServer().getPluginManager().getPlugin("Vault");
        if (vault == null) {
            log.severe("[TheLostFortress] Vault Not Found. Exit.");
            return;
        }
        perms = this.getServer().getServicesManager().getRegistration(net.milkbowl.vault.permission.Permission.class).getProvider();
        log.info(String.format("[%s] Using %s", getDescription().getName(), perms.getName()));
        //cmdExec = new CmdHandler();
        //SET HERE YOUR COMMANDS!
        PluginManager pm = getServer().getPluginManager();
        //SET HERE YOUR LISTENER!
    }
}
